﻿using System.Web.Configuration;
using System.Web.Mvc;
using System.Configuration;

namespace BabyShop.WebSite.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index() {
            return View("Default");
        }

        public ActionResult About() {
            return View();
        }

        public ActionResult Default() {
            return View();
        }

        public ActionResult ConfigEncryption()
        {
            Configuration webconfig = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
            ConfigurationSection section = webconfig.Sections["connectionStrings"];
            //section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
            section.SectionInformation.UnprotectSection();

            webconfig.Save();

            return Content("Webconfig is Encryption");
        }
    }
}
